package com.company.单例模式.懒汉模式;

public class Instance {
    private static Instance instance;

    private Instance() {
        System.out.println("懒汉模式");
    }
    public static synchronized Instance getInstance(){
        if (instance==null){
            instance=new Instance();
        }
        return instance;
    }
}
